package com.friend.controller.file;

import com.common.core.domain.Result;
import com.common.file.domain.OSSResult;
import com.friend.service.file.FileService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/file")
public class FileController {

    @Resource
    FileService fileService;

    @PostMapping("/upload")
    public Result<OSSResult> upload(@RequestBody MultipartFile file){
        return Result.success(fileService.upload(file));
    }
}
